﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using UniMana.Data;

namespace UniMana.Win.Training
{
    public partial class Frm_Score2_ScoreEditRequire_SubDetail : DevExpress.XtraEditors.XtraForm
    {
        private DBMain m_data = new DBMain();
        int _ID = 0;

        public Frm_Score2_ScoreEditRequire_SubDetail(int _ID)
        {
            InitializeComponent();
            this._ID = _ID;
        }

        private void Frm_Score2_ScoreEditRequire_SubDetail_Load(object sender, EventArgs e)
        {
            if (_ID != 0)
            {
                Log_ScoreEditInfo loginfo = new Log_ScoreEditInfo(_ID);
                if (loginfo.Properties.Log_ScoreEditKey > 0)
                {
                    grbResult.Text = "Kết quả duyệt phiếu " + loginfo.Properties.ID;
                    if (loginfo.Properties.Status.Value == true)
                    {
                        if (loginfo.Properties.Permit.Value == true)
                        {
                            lbcResult.Text = "ĐÃ DUYỆT PHIẾU YÊU CẦU";
                        }
                        else
                        {
                            lbcResult.Text = "KHÔNG DUYỆT PHIẾU YÊU CẦU";
                        }
                    }
                    else
                    {
                        lbcResult.Text = "ĐANG CHỜ DUYỆT PHIẾU YÊU CẦU";
                    }
                    lbcDatetimeRequire.Text = loginfo.Properties.CreateOn.ToString();
                    lbcDatetimeCensorship.Text = loginfo.Properties.DateCensorship.ToString();
                    rtbCensorshipRequire.Text = loginfo.Properties.Reasons;
                    if (loginfo.Properties.Feedback != "")
                    {
                        rtbReasonCensorship.Text = loginfo.Properties.Feedback;
                    }
                    else
                    {
                        rtbReasonCensorship.Text = "Không có lí do phản hồi";
                    }
                }
            }
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
